<%-content_for :page_title do-%>
  用户信息编辑 - 大满足日本语
<%-end-%>
<%-content_for :javascript_include do-%>
  <%= javascript_include_tag "WebCalendar.js" %>
<%-end-%>
<script type="text/javascript">
  $().ready(function() {
    $("#user_info_form").validate({
      rules: {
        "user_info[qq]": {
          maxlength:13
        },"user_info[msn]": {
          maxlength:30,
          email:true
        },"user_info[employment]": {
          maxlength:20
        },"user_info[address]": {
          maxlength:50
        }
      },
      messages:{
        "user_info[qq]": {
          maxlength: "请正确输入qq帐号."
        },"user_info[msn]": {
          maxlength: "请正确输入msn帐号.",
          email:"请输入有效的Email地址."
        },"user_info[employment]": {
          maxlength: "请输入正确的职业信息."
        },"user_info[address]": {
          maxlength: "请输入有效的现居地址."
        }
      },
      errorPlacement: function(error,element){
        error.appendTo(element.next());
      }
    });
  });
</script>
<div class="content">
  <div class="sub_nav clearfix">
    <ul>
      <li class="selected_tab"><a href="user_profile_update.html">用户信息编辑</a></li>
      <li><%=link_to '更新头像', edit_image_user_path(@current_user)%></li>
    </ul>
  </div>
  <div class="user_profile clearfix">
    <div id="message_box"></div>
    <%-remote_form_for @user_info, :url => update_user_profile_user_path(current_user),:before=>'$("#user_info_form").validate();', :html => {:id => 'user_info_form', :class => "user_profile_edit_form"} do |f|-%>
      <p>
        <%=label_tag 'nickname' ,'昵称:',:class=>'label'%>xanderzhang
      </p>
      <p>
        <%=label_tag 'gender','性别',:class=>'label'%>
        <%=select_tag("user_info[sex]", options_for_select({"男" => 0, "女" => 1}, @user_info.sex),:class => "text") %>
      <p>
      <p>
        <%=label_tag 'birthday' ,'出生年月',:class=>'label'%>
        <%= f.text_field :birthday,:class=>"text", :onclick => "SelectDate(this,'yyyy-MM-dd')", :readonly => true%>
        <span></span>
      </p>
      <p>
        <%=label_tag '职业' ,nil,:class=>'label'%>
        <%= f.text_field :employment,:class=>"text" %>
        <span></span>
      </p>
      <p>
        <%=label_tag '现居' ,nil,:class=>'label'%>
        <%= f.text_field :address,:class => "text"%>
        <span></span>
      </p>
      <p>
        <%=label_tag 'qq' ,'QQ',:class=>'label'%>
        <%= f.text_field :qq,:class=>"text" %>
        <span></span>
      </p>
      <p>
        <%=label_tag 'MSN' ,nil,:class=>'label'%>
        <%= f.text_field :msn,:class => "text"%>
        <span></span>
      </p>
      <p>
        <%=label_tag 'signature' ,'关于我',:class=>'label'%>
        <%= text_area :user_info ,:signature,:class=>'text'%>
      </p>
      <p class="p_submit">
        <input type="submit"  class="submit"  value="确认修改"/>
      </p>
    <%-end-%>
  </div>
</div>
